# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit eutils linux-mod

MY_PV="v${PV}-091009-1434"
MY_PN="${PN}-linux-src"

DESCRIPTION="Driver for the HighPoint RocketRAID 174x series of adaptors."
HOMEPAGE="http://www.highpoint-tech.com"

RESTRICT="mirror"
SRC_URI="http://www.support-highpoint-tech.com/Main/rr1740/Linux/opensrc/${MY_PN}-${MY_PV}.tar.gz"

LICENSE=""
KEYWORDS="~x86 ~amd64"

IUSE=""

DEPEND=""
RDEPEND="${DEPEND}"

S="${WORKDIR}/${MY_PN}-v${PV}"

MODULE_NAMES="rr174x(kernel/drivers/scsi:${S}/product/rr1740pm/linux)"
BUILD_TARGETS=" "
CONFIG_CHECK="PCI SCSI"

pkg_setup() {
	linux-mod_pkg_setup

    if kernel_is ge 2 6 31 ; then
        ewarn ""
        ewarn "This package has not been tested with this kernel version, and"
        ewarn "has been known to break on new kernel releases."
        ebeep
    fi

	BUILD_PARAMS="KERNELDIR=${KV_DIR}"
}

src_compile() {
	cd "${S}/product/rr1740pm/linux"
	make ${BUILD_PARAMS}
}

src_install() {
	dodoc README

	linux-mod_src_install
}

pkg_postinst() {
	linux-mod_pkg_postinst
	einfo "If you are using the rr174x controller to boot, you need to update your initrd."
}
